<?php
namespace services\thriftHandle;

use Services\RocketMqConsumer\MessageInfo;
use Services\RocketMqConsumer\Result;
use Services\RocketMqConsumer\RocketMqConsumerIf;

class RocketMqConsumerHandler implements RocketMqConsumerIf {

    public function receiveMsg( MessageInfo $messageInfo )
    {
        $result       = new Result();
        $result->code = 0;
        $result->msg  = 'ok';
        $message      = [
            'message_id' => $messageInfo->message_id,
            'topic'      => $messageInfo->topic,
            'tags'       => $messageInfo->tags,
            'msg'        => $messageInfo->msg,
            'key'        => $messageInfo->key,
        ];
        return $result;
    }
}
